package com.rec.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

@Entity
@Table(name="students")
@NoArgsConstructor
@AllArgsConstructor
public class Students {
		@Id
		@GeneratedValue(strategy=GenerationType.IDENTITY)
		private Integer id;
		private String cardno;
		private String name;
		private String sex;
		private Integer memberid;
		private Integer status;
		@ManyToOne(targetEntity=Memberships.class,fetch=FetchType.EAGER)
		@JoinColumn(name="memberid",insertable=false,updatable=false)
		private Memberships m;
		public Integer getId() {
			return id;
		}
		public void setId(Integer id) {
			this.id = id;
		}
		public String getCardno() {
			return cardno;
		}
		public void setCardno(String cardno) {
			this.cardno = cardno;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getSex() {
			return sex;
		}
		public void setSex(String sex) {
			this.sex = sex;
		}
		public Integer getMemberid() {
			return memberid;
		}
		public void setMemberid(Integer memberid) {
			this.memberid = memberid;
		}
		public Integer getStatus() {
			return status;
		}
		public void setStatus(Integer status) {
			this.status = status;
		}
		public Memberships getM() {
			return m;
		}
		public void setM(Memberships m) {
			this.m = m;
		}
		
}
